home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 128 10
/
q10.d81
/
t.128 shell
< prev
next >
Wrap
Text File
|
2022-08-28
|
14KB
|
357 lines
L O A D S T A R S H E L L 1 2 8
by Robert Rockefeller
The LOADSTAR Shell Utility gives C-128 users the ability to execute
machine-language programs by typing the name of the program, as well as a
RAM disk in bank one RAM in which machine-language and BASIC programs can
be loaded. Included with the shell program are ten useful utility
programs. Utility programs will execute from the RAM disk very quickly
indeed.
The shell program uses memory from address $1300 to address $1b00.
Since BASIC program storage starts at address $1c00, this means the shell
is compatible with normal BASIC programs. However, BASIC programs which
try to load machine-language, or POKE data to memory being used by the
shell will crash the computer. In our experience the shell is compatible
with the vast majority of BASIC programs.
The RAM disk starts at the top of RAM bank 1 at address $ff00, and
grows downwards from there. Any RAM which is not being used by the RAM disk
is available to BASIC for storage of strings, variables, and arrays. The
RAM disk can grow to a maximum size of about 57000 bytes, is protected from
BASIC and cannot be harmed by BASIC programs, except by programs which POKE
data to memory being used by the RAM disk. However, BASIC programs of this
type are very rare.
All in all the shell program has a very high degree of compatiblity
with BASIC programs, but will almost certainly crash if used with
commercial machine-language programs such as wordprocessors, paint
programs, etc.
The shell possesses a feature which will allow you to re-start the
shell after pressing the RESET button. This is useful when you have
programs in the RAM disk since you won't have to re-load. To restart just
execute SYS4870 from BASIC, or G 1306 from the monitor. The shell computes
its own checksum to verify code integrity, then it will compute the RAM
disk checksums. If the shell checksum is invalid the shell will not
re-start, and you must RUN"SHELL to re-start. If any of the programs in
the RAM disk are invalid their names will be listed, and they will be
marked invalid so they can't be loaded. In addition, you will be given the
opportunity to clear the RAM disk.
Shell utility programs can be loaded into the RAM disk with the LD
utility (see below) then executed by simply typing their names. BASIC
programs can also be loaded into the RAM disk with LD then RUN by
specifying a device number of 7. For example, you would type RUN"MAIL
LIST",U7 then type RETURN to execute the program "MAIL LIST".
If you wish to write your own machine-language programs for use with
the shell you must be aware of several things. First of all the program
filenames must begin with the letters "COM.". This is necessary so the
shell can distinguish shell programs from other types of files. Second of
all, the machine-language programs must be assembled to execute at address
$1c03. Thirdly, shell machine-language programs must terminate with a RTS
instruction, or by JMPing to address $1303. Last of all, like BASIC
variables, utility names cannot have a BASIC command embedded in it. For
example the name "COM.DCLR" would be an invalid name because it has the
command CLR in it.
As an example, one of the included shell programs named "COM.DL" will
list a BASIC program on disk. To execute it you merely need to type the
utility name without the "COM." prefix, plus the name of one or more files
you wish to list. For example, to list a BASIC program named "FILECOPY"
you would type DL "FILECOPY", then type the RETURN key. If you have more
than one disk drive you can specify a device number by prefixing it to the
filename. For example, DL "FILECOPY" 9,"RAMDOS" would list "FILECOPY" from
device 8, and "RAMDOS" from device 9. Filenames need not be enclosed in
quotes except when they contain a BASIC command. For example, "FILECOPY"
would need to be enclosed in quotes since it contains the BASIC command
COPY. "RAMDOS" would not necessarily need to be in quotes since it
contains no BASIC command. However, as a general rule we recommend that
filenames be enclosed in quotes.
The ten included utility programs are explained below.
"COM.TYPE"
TYPE displays disk text files on the screen. Either normal or screen
code files can be displayed. Screen code files can be specified by using
the +S switch. PET ASCII files are the default type, but can be specified
using the -S switch. Examples:
TYPE +S 9,"CODES" -S "TEXT1"
This would display a screen code file "CODES" from device 9, then a PET
ASCII file "TEXT1" from device 8.
TYPE "LETTER"
This would display a PET ASCII file "LETTER" from device 8.
"COM.DUMP"
DUMP displays disk files on the screen in both hexadecimal and text
format. Either normal or screen code files can be displayed. Screen code
files can be specified by using the +S switch. PET ASCII files are the
default type, but can be specified by using the -S switch. Examples:
DUMP +S 9,"CODES" -S "TEXT1"
This would display a screen code file "CODES" from device 9, then a PET
ASCII file "TEXT1" from device 8.
DUMP "LETTER"
This would display a PET ASCII file "LETTER" from device 8.
"COM.DL"
DL displays BASIC programs from disk on the screen. Example:
DL 9,"DATABASE" "SUBS"
This would display a BASIC program "DATABASE" from device 9, then the file
"SUBS" from device 8.
"COM.VAR"
VAR displays all defined variables and their values. This is mostly
useful during BASIC programming. Example: VAR
"COM.ARY"
ARY can do two things. ARY alone or ARY LIST lists the names and sizes
of all arrays. ARY followed by an array name will display the array on the
screen. This is mostly useful during BASIC programming. Examples:
ARY
This would display the names and sizes of all arrays.
ARY B
This would display the floating point array B.
ARY CE$
This would display the string array CE$
"COM.LD"
LD is provided to load files into the bank 1 RAM disk. Simply follow
the LD command with the names of files you wish loaded. See "COM.SUBMIT"
also. An alternative form LD CLR removes the RAM disk from memory.
Examples:
LD "COM.DIR"
Load "COM.DIR" into the RAM disk
LD "COM.TYPE" "COM.DUMP" "COM.DL"
Load "COM.TYPE", "COM.DUMP", and "COM.DL" into the RAM disk
"COM.DIR"
DIR is provided to display a directory of the files stored in the RAM
disk. Example:
DIR
Displays RAM disk directory.
"COM.COM"
COM is provided to specify the search order for COM files. The shell
always checks the RAM disk first. Normally device 8 is then searched.
However up to three disk devices can be specified to be searched in any
order. Examples:
COM 9 8
Specify that device 9 be searched after the RAM disk, then device 8.
COM 8 9 10
Specify that device 8 be searched after the RAM disk, then device 9, then
device 10.
COM 8
Specify that device 8 only be searched after the RAM disk.
"COM.SUBMIT"
SUBMIT is possibly the most versatile and useful command of all. It
allows you to execute lists of commands stored on disk just as if they had
been typed at the keyboard. Literally any command that you can type in can
be executed from a disk file. SUBMIT is useful when you find yourself
entering the same sequence of commands over and over. You can enter these
commands into a disk file and type one command to execute the disk file.
For example, if you fiad yourself regularly using LD to load several
utilities into the RAM disk, ysu can save typing by putting the LD command
in a SUBMIT file. If each line in a SUBMIT file begins with a line number,
the lines will be merged into the BASIC program text.
SUBMIT works almost exactly like "SUBMIT.COM" does under CP/M for
those familiar with CP/M. SUBMIT files must have a "SUB." prefix.
"SUB.LDALL" is an example of a SUBMIT filename. Follow the SUBMIT command
with the name of the file you wish to execute. For example, SUBMIT "LDALL"
would execute the file "SUB.LDALL".
You can pass parameters to SUBMIT files when they are executed. Each
parameter is scanned and a textual substitution takes place